 {include file="public/header" type="other"/}
 <style>
 	@media(max-width:760px) {
 		.layui-form-label {
 			float: unset;
 			display: unset;
 			padding: unset;
 			width: unset;
 			font-weight: unset;
 			line-height: unset;
 			text-align: unset;
 		}

 		.layui-input-block {
 			margin-left: unset;
 			min-height: unset;
 		}
 	}
 </style>
 	<form class="layui-form" action="">
 		<div class="mainBox">
 			<div class="main-container">
 			    <input type="text" name="user_id" class="layui-input" value="{:$model['creator_id']}" style="display:none;">
 			    <div class="layui-form-item">
 					<label class="layui-form-label">
 						工单标题
 					</label>
 					<div class="layui-input-block">
 					    <input type="text" name="title" class="layui-input" value="{:$model['title']}" disabled>
 					</div>
 				</div>
 			    <div class="layui-form-item">
 					<label class="layui-form-label">
 						工单内容
 					</label>
 					<div class="layui-input-block">
 					    <textarea name="content" class="layui-textarea" disabled>{:$model['content']}</textarea>
 					</div>
 				</div>
 				<div class="layui-form-item">
 					<label class="layui-form-label">
 						回复内容
 					</label>
 					<div class="layui-input-block">
 					    <textarea name="reply_content" class="layui-textarea">{:$model['reply_content']}</textarea>
 					</div>
 				</div>
 				<div class="layui-form-item">
 						<label class="layui-form-label">
 							工单状态
 						</label>
 						<div class="layui-input-block">
 							<input type="radio" name="status" value="0" 
 								title="待处理" {if $model['status'] == 0} checked {/if}>
 							<input type="radio" name="status" value="1" 
 								title="处理中" {if $model['status'] == 1} checked {/if}>
 							<input type="radio" name="status" value="2" 
 								title="已回复" {if $model['status'] == 2} checked {/if}>
 							<input type="radio" name="status" value="3" 
 								title="已关闭" {if $model['status'] == 3} checked {/if}>
 						</div>
 					</div>
 			</div>
 		</div>
 		<div class="bottom">
 			<div class="button-container">
 				<button type="submit" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit="" lay-filter="save">
 					<i class="layui-icon layui-icon-ok"></i>
 					提交
 				</button>
 				<button type="reset" class="layui-btn layui-btn-primary layui-btn-sm">
 					<i class="layui-icon layui-icon-refresh"></i>
 					重置
 				</button>
 			</div>
 		</div>
 	</form>
 	{include file="public/footer"/}
 	<script>
 		layui.use(['form', 'jquery'], function() {
 			let form = layui.form;
 			let $ = layui.jquery;
            let MODULE_PATH = "{$Request.root}/ypay.shop/";
 			
 			//建立编辑器

 			form.on('submit(save)', function(data) {
 				$.ajax({
 					data: JSON.stringify(data.field),
 					dataType: 'json',
 					contentType: 'application/json',
 					type: 'post',
 					success: function(res) {
 						//判断有没有权限
 						if (res && res.code == 999) {
 							layer.msg(res.msg, {
 								icon: 5,
 								time: 2000,
 							})
 							return false;
 						} else if (res.code == 200) {
 							layer.msg(res.msg, {
 								icon: 1,
 								time: 1000
 							}, function() {
 								parent.layer.close(parent.layer.getFrameIndex(window
 									.name)); //关闭当前页
 								parent.layui.table.reload("ticket");
 							});
 						} else {
 							layer.msg(res.msg, {
 								icon: 2,
 								time: 1000
 							});
 						}
 					}
 				})
 				return false;
 			});
 		})
 	</script>
 </body>
 </html>
